<!DOCTYPE html>
<html>
<head>
    <title>管理员列表 - 后台管理系统</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" type="text/css" href="../../../static/layui/css/layui.css" media="all">
    <script type="text/javascript" src="../../../static/layui/layui.js"></script>
    <style type="text/css">
        .header span{background:#009688;margin-left:30px;padding:10px;color:#ffffff;}
        .header div{border-bottom:solid 2px #009688;margin-top: 8px;}
        .header button{float:right;margin-top:-5px;}
    </style>
</head>
<body style="padding:10px; box-sizing: border-box;">
<form class="layui-form">
    <input type="hidden" class="layui-input" name="smid" value="{$find['smid']}">
    <div class="layui-form-item">
        <label class="layui-form-label">导航名</label>
        <div class="layui-input-inline">
            <input type="text" class="layui-input" name="label" placeholder="请输入导航名" value="{$find['label']}">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">排序</label>
        <div class="layui-input-inline">
            <input type="text" class="layui-input" name="sort" placeholder="请输入排序值(越大越考前)" value="{$find['sort']}">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">状态</label>
        <div class="layui-input-block">
            <input type="radio" name="status" value="1" title="开启" {if($find['status']==1)} checked {/if}>
            <input type="radio" name="status" value="0" title="禁用" {if($find['status']==0)} checked {/if}>
        </div>
    </div>
</form>
<div class="layui-form-item">
    <div class="layui-input-block">
        <button type="button" class="layui-btn" onclick="save()">保存</button>
    </div>
</div>
<script type="text/javascript">
    layui.use(['form'],function(){
        form = layui.form;
        $ = layui.jquery
    });

    function save(){
        $.post("/tp5/public/index.php/bews/Bew/menuModify",$('form').serialize(),function (res){
            console.log("res "+res)
            if(res.code === 0){
                layer.msg(res.msg,{'icon':1})
                setTimeout(function (){
                    parent.window.location.reload();   // 关闭上一层页面
                },1000)
            }else{
                layer.msg(res.msg,{'icon':2})
            }
        },'json')
    }
</script>
</body>
</html>